<template>
  <NvCrud :option :data :pagination />
</template>

<script setup lang="ts">
import type { PaginationProps } from 'naive-ui'
import type { NvCrudOption } from 'nv-crud'
import { NvCrud } from 'nv-crud'
import { reactive } from 'vue'

const pagination = reactive<PaginationProps>({
  pageSize: 3,
})

const data = Array.from({ length: 100 }, (_, i) => ({
  name: `name${i + 1}`,
  sex: i % 2 === 0 ? '男' : '女',
  age: i + 1,
}))

const option: NvCrudOption = {
  layout: 'simple',
  rowActions: false,
  actionbar: false,
  fields: {
    name: { title: '姓名' },
    sex: { title: '性别' },
    age: { title: '年龄' },
  },
}
</script>
